Page({

  /**
   * 页面的初始数据
   */
  data: {
    detail:{},
    index:""
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (e) {
    var plan = wx.getStorageSync("plan");
    var detail = plan[e.index];
    console.log(detail)
    this.setData({
      index:e.index,
      detail:detail
    })
  },
  onShow:function(){
    console.log(1)
  },

  minChange: function (e) {
    var target="detail.min"
    this.setData({
      [target]: e.detail.lowValue
    })
  },

  maxChange: function (e) {
    var target = "detail.max"
    this.setData({
      [target]: e.detail.heighValue
    })
  },

  valueChange: function (e) {
    var target = "detail.value"
    this.setData({
      [target]: e.detail.heighValue
    })
  },
  submit:function(){
    var plan = wx.getStorageSync("plan");
    plan[this.data.index] = this.data.detail;
    wx.setStorageSync("plan",plan);
    wx.navigateBack()
  }
})